package cn.redsoft.wechatapi.msg.req;

import cn.redsoft.wechatapi.common.util.MsgTypeConverter;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;

public abstract class RequestMsg {
	@XStreamAlias("ToUserName")
	protected String toUserName;

	@XStreamAlias("FromUserName")
	protected String fromUserName;

	@XStreamAlias("CreateTime")
	protected Long createTime;

	@XStreamAlias(value = "MsgType")
	@XStreamConverter(value = MsgTypeConverter.class)
	protected RequestMsgType msgType;

	@XStreamAlias("MsgId")
	protected long msgId;

	public RequestMsg() {
	}

	public RequestMsg(String toUserName, String fromUserName, Long createTime,
			RequestMsgType msgType, long msgId) {
		super();
		this.toUserName = toUserName;
		this.fromUserName = fromUserName;
		this.createTime = createTime;
		this.msgType = msgType;
		this.msgId = msgId;
	}

	public String getToUserName() {
		return toUserName;
	}

	public void setToUserName(String toUserName) {
		this.toUserName = toUserName;
	}

	public String getFromUserName() {
		return fromUserName;
	}

	public void setFromUserName(String fromUserName) {
		this.fromUserName = fromUserName;
	}

	public Long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Long createTime) {
		this.createTime = createTime;
	}

	public RequestMsgType getMsgType() {
		return msgType;
	}

	public void setMsgType(RequestMsgType msgType) {
		this.msgType = msgType;
	}

	public long getMsgId() {
		return msgId;
	}

	public void setMsgId(long msgId) {
		this.msgId = msgId;
	}

	@Override
	public String toString() {
		return "RequestMsg [toUserName=" + toUserName + ", fromUserName="
				+ fromUserName + ", createTime=" + createTime + ", msgType="
				+ msgType + ", msgId=" + msgId + "]";
	}

}
